#Author: Tanyong
# *-* coding:utf8 *-*
# @time       : 18-7-16 下午8:09
# @Author     : Tanyong
# @Site       : 
# @File       : forms.py
# @Software   : PyCharm
from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField
from wtforms.validators import DataRequired


class InfoForm(FlaskForm):
    """
    股票信息表单
    id = db.Column(db.Integer, primary_key=True)
    code = db.Column(db.String(6), unique=True)
    short = db.Column(db.String(50))
    chg = db.Column(db.String(50))
    turnover = db.Column(db.String(50))
    price = db.Column(db.String(50))
    highs = db.Column(db.String(50))
    time = db.Column(db.DateTime, default=datetime.now())
    """

    code = StringField(
        label="股票代码",
        validators=[
            DataRequired("请输入股票代码")
        ]
    )
    short=StringField(
        label="股票简称",
        validators=[
            DataRequired("请输入股票简称")
        ]
    )
    chg = StringField(
        label="涨跌幅",
        validators=[
            DataRequired("请输入股票涨跌幅")
        ]
    )
    turnover=StringField(
        label="股票换手率",
        validators=[
            DataRequired("请输入股票换手率")
        ]
    )
    price=StringField(
        label="股票价格",
        validators=[
            DataRequired("请输入股票价格")
        ]
    )
    highs=StringField(
        label="股票最高点",
        validators=[
            DataRequired("请输入股票最高点")
        ]
    )
    submit = SubmitField(
        '保存',
        render_kw={
            "class": "btn btn-primary",
        }
    )
